﻿using Framework.Common;
using Framework.Common.Paged;
//*********************************************************************
//
//  文件名：IUserService
//
//  作者： LW
//
//  作用：
//
//  日期：2015/9/15 10:09:39
//
//*********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YouTravel.DomainModels;
using YouTravel.QueryModels;
using YouTravel.ViewModels;

namespace YouTravel.DomainService
{
    /// <summary>
    /// 用户操作接口
    /// </summary>
    public interface IUserService
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="account"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        UserViewModel Login(string account, string pwd);
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="oldPwd"></param>
        /// <param name="newPwd"></param>
        /// <param name="newPwdConfirm"></param>
        /// <param name="operateUserId"></param>
        void ChangePassword(int userId, string oldPwd, string newPwd, string newPwdConfirm, int operateUserId);
        /// <summary>
        /// 账号设置
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="relName"></param>
        /// <param name="phone"></param>
        /// <param name="operateUserId"></param>
        void AccountSet(int userId, string phone, int operateUserId);
        /// <summary>
        /// 添加账号
        /// </summary>
        /// <param name="user"></param>
        void AccountAdd(UserViewModel user, int operateUserId);
        /// <summary>
        /// 更新账号
        /// </summary>
        /// <param name="user"></param>
        void AccountUpdate(UserViewModel user, int operateUserId);
        /// <summary>
        /// 账号启用/冻结
        /// </summary>
        /// <param name="userId"></param>
        void AccountEnabled(int userId, int operateUserId);
        /// <summary>
        /// 账号销户
        /// </summary>
        /// <param name="userId"></param>
        void AccountCancellation(int userId, int operateUserId);
        /// <summary>
        /// 设置账号权限
        /// </summary>
        /// <param name="user"></param>
        void SetAuthorityAccount(UserViewModel user, int operateUserId);
        /// <summary>
        /// 得到指定账号
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        UserViewModel GetModel(int userId);
        /// <summary>
        /// 得到指账号权限
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        UserViewModel GetAccountAuthority(int userId);
        /// <summary>
        /// 根据登录人得到相应菜单权限
        /// </summary>
        /// <param name="operateUserId"></param>
        /// <returns></returns>
        [Obsolete("此方法已废弃")]
        List<MenuViewModel> GetMenuByLoginUser(int operateUserId);
        /// <summary>
        /// 得到账号列表
        /// </summary>
        /// <param name="queryCond"></param>
        /// <returns></returns>
        CustomPagedList<UserViewModel> GetList(PagedParam<UserQuery> queryCond);
        /// <summary>
        /// 得到机构下拉列表
        /// </summary>
        /// <param name="operateUserId"></param>
        /// <returns></returns>
        List<ComboxData> GetOrgCombox(int operateUserId);
        /// <summary>
        /// 忘记密码
        /// 初始化为6个0
        /// </summary>
        /// <param name="forgetPwd">密码信息</param>
        void ForgetPassword(ForgetPasswordViewModel forgetPwd);
        /// <summary>
        /// 验证手机是否存在
        /// </summary>
        /// <param name="phone"></param>
        /// <returns></returns>
        bool CheckPhone(string phone);
    }
}
